varying vec3 normal;

void main(){
	float intensity;
	vec4 color;
	vec3 n = normalize(normal);
	// quantize to 8 steps (0, 1/7, 2/7 ...)
	intensity = (floor(dot(l, n)*7.0) + 1.0)/7.0;
	color = vec4(intensity, intensity, intensity, 1.0);
	gl_FragColor = color;
}